package base_grammar

import "fmt"

type Pet interface {
	eat()
	eat2()
}

type Dog struct {
	name string
}

func (dog Dog) eat() {
	fmt.Printf("dog: %p\n", &dog)
	fmt.Println("dog eat1")
	dog.name = "嘿嘿"
}
func (dog *Dog) eat2() {
	fmt.Printf("dog: %p\n", dog)
	fmt.Println("dog eat2")
	dog.name = "嘿嘿"
}

func Interface_test2() {
	var dog = Dog{"花花"}
	fmt.Printf("dog: %p\n", &dog)
	dog.eat()
	fmt.Printf("dog: %v\n", dog)
	fmt.Println("===========")
	dog.eat2()
	fmt.Printf("dog: %v\n", dog)

}
